<?php

/**
 * Joueur form.
 *
 * @package    tournoiPing
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class JoueurForm extends BaseJoueurForm {

    public function configure() {

        $this->setWidget('tableau_list', new sfWidgetFormDoctrineChoiceWithParams(
                        array(
                            'multiple' => true,
                            'model' => 'Tableau',
                            'expanded' => true,
                            'table_method' => array('method' => 'test', 'parameters' => array($this->getObject())))));
        $this->getWidget('club_id')->addOption('order_by', array('label', 'asc'));
        $this->setWidget('sexe', new sfWidgetFormChoice(array(
                    'choices' => array('M' => 'Masculin', 'F' => 'Féminin'),
                    'multiple' => false,
                    'expanded' => true
                )));

        $this->validatorSchema['licence'] = new sfValidatorAnd(array(
                    $this->validatorSchema['licence'],
                    new sfValidatorInteger(),
                ));

        $this->widgetSchema->setFormFormatterName('list');

//        $this->widgetSchema->setHelp('licence', 'Whether the job can also be published on affiliate websites or not.');
    }

}
